import api from "@/libs/request";

/**
 * 添加优惠券
 * @param data
 */
export const addCoupon = (data: any) => {
  return api.post(`/discount/manager/coupon/add`, data);
};

/**
 * 编辑优惠券
 */
export const editCoupon = (data: any) => {
  return api.put(`/discount/manager/coupon/update`, data);
};

/**
 * 获取积分优惠券列表
 */
export const couponIntList = (data: any) => {
  return api.get(`/discount/manager/coupon/integral/list`, data);
};

/**
 * 获取优惠券列表
 */
export const couponList = (data: any) => {
  return api.get(`/discount/manager/coupon/list`, data);
};

/**
 * 查看优惠券详情
 */
export const couponDetail = (id: any, data: any) => {
  return api.get(`/discount/manager/coupon/get/${id}`, data);
};

/**
 * 批量删除优惠券
 */
export const delCoupons = (ids: any, data: any) => {
  return api.delete(`/discount/manager/coupon/delete/${ids}`, data);
};

/**
 * 关闭优惠券
 */
export const offCoupons = (status: any, data: any) => {
  return api.put(`/discount/manager/coupon/changeStatus/${status}`, data);
};

/**
 * 获取优惠券商品
 */
export const getCouponsGoods = (data: any) => {
  return api.get(`/goods/manager/product/discount/list`, data);
};
